import { Immit } from '@/utils';
import { myEnv } from '@/myEnv';
export abstract class UserInfo_Abs extends Immit {
    /**用户昵称 */
    nickName: string = null;
    /**用户电话号码 */
    userPhoneNumber: string = null;
    /**用户头像 */
    avatarUrl: string = null;
    /**用户联系地址*/
    contractAddress: string = null;
    /**实名认证id */
    realId: string = null;
    /**实名认证姓名 */
    realName: string = null;
    /**是否实名认证 */
    abstract hasIdentifiedRealName: 0 | 1 | boolean;
    /**是否入驻*/
    abstract isRegisteredArtist: 0 | 1 | boolean;
}

export class UserInfo_Res extends UserInfo_Abs {
    isRegisteredArtist: 0 | 1 = 0;
    hasIdentifiedRealName: 0 | 1 = 0;
}

export class UserInfo_Web extends UserInfo_Abs {
    isRegisteredArtist: boolean = false;
    hasIdentifiedRealName: boolean = false;
    immit_response?(data: Partial<UserInfo_Res>) {
        this.immit(data);
        this.avatarUrl = myEnv.BASE_URL + data.avatarUrl;
        this.isRegisteredArtist = data.isRegisteredArtist == 0 ? false : true;
        this.hasIdentifiedRealName = data.hasIdentifiedRealName == 0 ? false : true;
        return this;
    }
}
